<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>用户点评</title>
    <script src="../js/jquery-1.12.4.js"></script>
    <script src="../layui/layui.js"></script>
    <link rel="stylesheet" type="text/css" href="../layui/css/layui.css"/>
    <link rel="stylesheet" type="text/css" href="../css/floatmuen.css"/>
    <link rel="stylesheet" type="text/css" href="../css/pub_head.css"/>
    <link rel="stylesheet" type="text/css" href="../css/pub_footer.css"/>
    <link rel="stylesheet" href="../css/navigation.css">
    <link rel="stylesheet" href="../css/properties/proNav.css">
    <link rel="stylesheet" href="../css/properties/pro.css">
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=kwKWiw65Q3LdHE6ZIIGyU3DTGSRoYF5G"></script>
</head>
<body>
    <ul id="floatMul"></ul>
    <div id="head" th:include="../static/publichtml/public_pageHead :: footer1"></div><!-- 头部导入 -->
    <div id="navigation"></div>
    <div id="proNav"></div>

    <div class="commAll">
        <div class="commAll_left">
            <div class="commAll_left_d1">
                全部点评
            </div>
            <div class="commAll_left_d2">
                <span class="newCommBtn">最新点评</span>
                <span class="hotCommBtn">热门点评</span>
                <span class="writeCommBtn"><span class="layui-icon layui-icon-edit"></span>写点评赢积分，我要点评</span>
            </div>
            <div>
                <div class="proInfo_d6_right_d2_pl2" th:each="c:${commentlist}" th:value="${c.id}">
                    <div class="pl1">
                        <div class="pl1_d1">
                            <img th:src="@{'../images/userimg/'+${c.user.picture}}" />
                        </div>
                        <div class="pl1_d2">
                            <p class="pl1_d2_p1" th:text="${c.user.linkman}">憨憨猪</p>
                            <p class="pl1_d2_p2" th:text="${c.content}">aaaaaaaaaaaaa</p>
                        </div>
                        <div class="pl1_d3" th:text="${c.beginTime}">03-10</div>
                    </div>
                    <div class="pl2" th:each="cz:${c.clist}">
                        <div class="pl1_d1">
                            <img th:src="@{'../images/userimg/'+${cz.user.picture}}" />
                        </div>
                        <div class="pl1_d2">
                            <p class="pl1_d2_p1" th:text="${cz.user.linkman}">憨憨猪</p>
                            <p class="pl1_d2_p2" th:text="${cz.content}">aaaaaaaaaaaaaaaa</p>
                        </div>
                        <div class="pl1_d3" th:text="${cz.beginTime}">03-10</div>
                    </div>
                    <div class="pl3">
							<span class="pl3_s1">
								<span class="layui-icon layui-icon-notice"></span>&nbsp;(<span class='plcount' th:text="${c.clist.size()}"></span>)
							</span>
                        &nbsp;|&nbsp;
                        <span onclick='pl_s2F(this)'>
								<span class="layui-icon layui-icon-praise"></span>&nbsp;(<span class='goodcount' th:text="${c.good}"></span>)
							</span>
                    </div>
                </div>
            </div>
            <div id="housefy" style="text-align: center;" th:value="${countPage}"></div>
        </div>
        <div class="commAll_right">
            <div class="commAll_right_d1">
                <div style="width:258px;margin: 0px auto;height:152px;border:#ccc solid 1px;font-size:12px"
                     id="map"></div>
                <div style="margin-top: 15px; margin-left: 15px;"><a style="color: red;">更多配套信息 > ></a></div>
            </div>
            <div class="commAll_right_d2">
                <div id="phone_number_service"><i style="font-size: 25px;" class="layui-icon layui-icon-service">
                    400-600-0716</i></div>
                <div id="phone_number_detail">
                    您可以拨打保利堂悦售楼处电话进行咨询，
                    本页面信息由荆州好房子网搜集，
                    <br>具体信息以售楼处公布的信息为准。
                </div>
            </div>
            <div class="commAll_right_d3">
                <table id="Surrounding_buildings_table">
                    <tr th:each="p:${prozblist}">
                        <td><a style="width: 100px;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;" th:href="@{'pro1?id='+${p.id}}" th:text="${p.name}">丰景园</a></td>
                        <td><span th:text="${p.area}"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span th:text="${p.price==null?'待定':p.price}"></span></td>
                    </tr>
                </table>
            </div>
        </div>
    </div>

    <div id="footer"></div>
    <div id="hfmain">
        <div class="hf_com">
            <div class="hf_com_d1">
                <span class="hf_com_d1_s1">楼盘回复</span>
                <span class="layui-icon layui-icon-close hf_com_d1_s2"></span>
            </div>
            <div class="hf_com_d2">
                <textarea class="hf_com_d2_tx" placeholder="请输入回复内容"></textarea>
                <div class="hf_com_d2_d1">
                    <span class="hf_com_d2_ts"></span>
                    温馨提示：请文明上网理性发言→_→
                    <span class="hf_sub">立即回复</span>
                </div>
            </div>
        </div>
    </div>
    <script th:inline="javascript">
        var type = /*[[${type}]]*/ 1;
        var p = /*[[${session.p}]]*/ {};
        console.log(type)
        if(type==1){
            $(".newCommBtn").addClass("commAll_red");
        }else{
            $(".hotCommBtn").addClass("commAll_red");
        }
        $(function(){
            $("#floatMul").load("../../publichtml/floatMune.html");
            //$("#head").load("../../publichtml/public_pageHead.html");
            $("#footer").load("../../publichtml/pub_footer.html");
            $("#navigation").load("../publichtml/navigation2.html");
            $("#footer").load("../publichtml/pub_footer.html");
            $("#proNav").load("../../publichtml/proNav.html",function(){
                $(".proNav_ul>li").removeClass("proNav_ul_click").eq(4).addClass("proNav_ul_click");
                $(".proTitle").text(p.name);
                $(".proStatus").text(p.status);
                var spanC='';
                $.each(p.chapros,function (i,d){
                    spanC+="<span class='proCha'>"+d.characteristic.name+"</span>";
                })
                $(".proNav_title_d1_d2").html(spanC);
            });
        });
        var pagel = {
            elem: 'housefy'
            ,count: $("#housefy").attr("value")
            ,limit: 6
            ,curr: /*[[${index}]]*/ {}
            ,first: '首页'
            ,last: '尾页'
            ,jump: function(obj,first){
                if(!first){
                    location.href="comm?index="+obj.curr+"&size="+obj.limit+"&type="+type;
                }
            }
        };
        layui.use(['laypage', 'layer'], function(){
            var laypage = layui.laypage
                ,layer = layui.layer;

            laypage.render(pagel);
        });
        $(".newCommBtn").click(function (){
            type = 1
            $(this).addClass("commAll_red");
            $(".hotCommBtn").removeClass("commAll_red");
            location.href="comm?index=1&size=6&type=1";
        });
        $(".hotCommBtn").click(function (){
            type = 2
            $(this).addClass("commAll_red");
            $(".newCommBtn").removeClass("commAll_red");
            location.href="comm?index=1&size=6&type=2";
        });
        //评论
        var fid = 0;
        $(".writeCommBtn").click(function (){
            $("#hfmain").css("display","flex");
            fid = 0;
        });
        <!--    模板    -->
        var pldiv;//保存是点的评论div控件
        $(".hf_com_d1_s2").click(function(){
            $("#hfmain").css("display","none");
        });
        $(".pl3_s1").click(function(){
            fid = $(this).parent().parent().attr("value");
            $("#hfmain").css("display","flex");
        });
        $(".hf_sub").click(function (){
            subpl();
        });
        function subpl(){
            var tx = $(".hf_com_d2_tx").val().trim();
            if(tx.length==0){
                $(".hf_com_d2_ts").text("请输入回复内容!");
            }else{
                $(".hf_com_d2_ts").text("");
                $.ajax({
                    url:"../comm/insert",
                    data:{context:tx,pid:p.id,fid},
                    async:false,
                    success:function (data){
                        if(data){
                            $(".hf_com_d2_tx").val("");
                            $("#hfmain").css("display","none");
                            location.href="comm?index=1&size=6&type=1";
                        }else{
                            $(".hf_com_d2_ts").text("回复失败!");
                        }
                    }
                });
            }
        }
        var mAddress = /*[[${mapAddress}]]*/ {};
        function initMap(){
            createMap();//创建地图
            setMapEvent();//设置地图事件
            addMapControl();//向地图添加控件
            addMapOverlay();//向地图添加覆盖物
        }
        function createMap(){
            map = new BMap.Map("map");
            map.centerAndZoom(new BMap.Point(112.300071,30.301515),14);
        }
        function setMapEvent(){
            map.enableScrollWheelZoom();
            map.enableKeyboard();
            map.enableDragging();
            map.enableDoubleClickZoom()
        }
        function addClickHandler(target,window){
            target.addEventListener("click",function(){
                target.openInfoWindow(window);
            });
        }
        function addMapOverlay(){

        }
        //向地图添加控件
        function addMapControl(){
        }
        var map;
        initMap();
    </script>
</body>
</html>